import { lazy } from 'react';
import LazyLoad from '../../components/LazyLoad';
import { RouteItem } from '../Type';

const routers: Array<RouteItem> = [
    {
        meta: {
            key: 'error',
            title: '错误页面',
        },
        children: [
            {
                path: '/403',
                element: LazyLoad(lazy(() => import('../../view/error/NotAuth'))),
                meta: {
                    requiresAuth: true,
                    title: '403页面',
                    key: '403',
                },
            },
            {
                path: '/404',
                element: LazyLoad(lazy(() => import('../../view/error/NotFound'))),
                meta: {
                    requiresAuth: true,
                    title: '404页面',
                    key: '404',
                },
            },
            {
                path: '/500',
                element: LazyLoad(lazy(() => import('../../view/error/NotNetwork'))),
                meta: {
                    requiresAuth: true,
                    title: '500页面',
                    key: '500',
                },
            },
        ],
    },
];

export default routers;
